version 18
set more off
  quietly log
  local logon = r(status)
  if "`logon'" == "on" { 
	log close 
	}
log using mb2026sppq.log, text replace

/*		****************************************************************************	*/
/* 		Author:			Frederick J. Boehmke and Abigail Matthews						*/
/*		Date:			January 9, 2026													*/
/*  	File:			mb2026sppq.do      												*/
/*		Purpose:		Replicate the figures reported in Matthews and Boehmke's SPPQ 	*/
/*						article on diffusion for the SPPQ 25th anniversary series.		*/
/*  	Input File: 	mb2026sppq.xlsx 												*/
/*  	Output File: 	mb2026sppq.log													*/
/*						mb2026sppq-figXX.png											*/
/*						"Policy Diffusion articles listing for appendix.xlsx"			*/
/*						"Policy Diffusion articles listing for appendix.docx"			*/
/*		***************************************************************************		*/

	/*****************************************/
	/* Read in the listing of SPPQ articles. */
	/*****************************************/

	
import excel using mb2026sppq.xlsx, sheet("Full Listing") clear case(lower) firstrow
	
	
	/*******************************************/
	/* Tables with basic features of the data. */
	/*******************************************/


table year
table category 
table year category

table year issue, missing

	
	/***********************/
	/* Create the figures. */
	/***********************/
	
		/* Figure 1. */
	
graph bar (count) year, over(category, label(labsize(large))) scheme(s1mono) ///
	bar(1, color(black)) ///
	ylabel(#5, grid angle(0) labsize(medlarge)) ///
	ytitle("Number of Articles", size(vlarge)) ///
	xsize(6) ysize(2)
	
	graph export mb2026sppq-fig01.png, replace width(3000)
	
		/* Figure 2. */
	
histogram year if category!="Adjacent", discrete frequency scheme(s1mono) ///
	bcolor(black) barwidth(0.65) ///
	xlabel(2000(1)2025, labsize(medium)) ///
	ylabel(#5, grid angle(0) labsize(medium)) ///
	xtitle("") ///
	ytitle("Number of Articles", size(vlarge)) ///
	xsize(6) ysize(2) ///
	text(7 2016.5 "Special Issue on policy diffusion" "published in 2016 with 7 articles.", placement(east) size(medlarge) justification(left))
	
	graph export mb2026sppq-fig02.png, replace width(3000)
	
		/* Figure 3. */
	
histogram year if category!="Other", discrete frequency scheme(s1mono) ///
	by(category, rows(1) note("")) horizontal subtitle( , size(medsmall) bcolor(white)) ///
	bcolor(black) barwidth(0.65) ///
	ylabel(2000(1)2025, labsize(vsmall) angle(0)) ///
	xlabel(#5, grid) ///
	yscale(reverse) ///
	xtitle(Number of Articles, size(medsmall)) ///
	ytitle("") ///
	xsize(6) ysize(5)
	
	graph export mb2026sppq-fig03.png, replace width(3000)

	
	/************************************************/
	/* Run a regression to support the claim of no  */ 
	/* time trends in diffusion article count.      */
	/************************************************/
	
		/* Convert to annual data with count of diffusion articles. */
	
contract year, freq(num)
	
correlate num year

		/* Test for simple linear trend. */
	
regress num year 

		/* Allow for nonlinear trend with indicator for special issue in 2016. */
	
regress num c.year##c.year 2016.year

		/* Visualize with locally smoothed polynomial. */
	
lpoly num year, noscatter bw(2) ci legend(off)

clear
log close
exit, STATA
